home
***
CD-ROM
|
disk
|
other
***
search
/
SGI Hot Mix 8
/
Hot Mix 8.iso
/
.all
/
demos
/
Z-Mail
/
RemoveIt2
(
.txt
)
< prev
Wrap
Text File
|
1994-06-22
|
3KB
|
117 lines
#!/bin/csh -f
# This script will remove the INST_PATH directory created by the
# InstallIt2 script.
switch ( `uname -r` )
case 5* :
set INST_DIR=zmail.sgi5
breaksw
default :
set INST_DIR=zmail.sgi
breaksw
endsw
# Determine INST_PATH from the HOTMIXPATH* file.
#
# First, try /usr/tmp. If not there, try the user's home directory,
# and finally, /tmp. If not in any of these places, ask for the
# name of the path. If the user doesn't know (or forgets) where
# the software was installed, we're SOL. Remove the file after
# using it.
if ( -r /usr/tmp/HOTMIXPATH_$INST_DIR ) then
source /usr/tmp/HOTMIXPATH_$INST_DIR
sleep 2
else if ( -r ~/HOTMIXPATH_$INST_DIR ) then
source ~/HOTMIXPATH_$INST_DIR
sleep 2
else if ( -r /tmp/HOTMIXPATH_$INST_DIR ) then
source /tmp/HOTMIXPATH_$INST_DIR
sleep 2
else
LOOP1:
echo " "
echo "Enter the full path name of the directory"
echo "where the demo is installed (or 'q' to quit): \c"
set INST_PATH=($<)
if ( $#INST_PATH == 0 ) then
echo " "
echo "Input error. Please try again."
goto LOOP1
else if ( $INST_PATH == 'q' ) then
echo " "
echo "... Bye."
sleep 3
exit
endif
endif
# Remove the installation directory.
if ( -r $INST_PATH ) then
if ( -w $INST_PATH ) then
echo " "
echo "About to remove the entire $INST_PATH directory."
echo "Is this OK (y/n)? \c"
set ans=($<)
if ( $ans == 'y' ) then
echo " "
echo "Removing $INST_PATH. Please wait..."
/bin/rm -rf $INST_PATH
/bin/rm -f /usr/tmp/HOTMIXPATH_$INST_DIR > /dev/null
/bin/rm -f ~/HOTMIXPATH_$INST_DIR > /dev/null
/bin/rm -f /tmp/HOTMIXPATH_$INST_DIR > /dev/null
echo " "
echo "Removal complete."
sleep 3
exit
else
echo "... Bye."
sleep 3
exit
endif
else
echo " "
echo "You do not have permission to remove the $INST_PATH directory."
echo "If you are SURE you want to remove this, you will be asked"
echo "for the root password before proceeding."
echo " "
echo "Continue (y/n)? \c"
set ans=($<)
if ( $ans == 'y' ) then
echo " "
echo "Removing $INST_PATH. Please wait..."
su - root -c "/bin/rm -rf $INST_PATH"
echo " "
echo "Removal complete."
sleep 3
exit
else
echo " "
echo "... Bye."
sleep 3
exit
endif
endif
else
echo " "
echo "Could not find the $INST_PATH directory. Please try again."
echo " "
echo "... Bye."
/bin/rm -f /usr/tmp/HOTMIXPATH_$INST_DIR > /dev/null
/bin/rm -f ~/HOTMIXPATH_$INST_DIR > /dev/null
/bin/rm -f /tmp/HOTMIXPATH_$INST_DIR > /dev/null
sleep 10
endif
exit 0